package com.itheima.demo01;

//老师类, 子类, 让该类继承Person类.
public class Teacher extends Person {
    //1. 核心细节: 子类的空参访问父类的空参, 子类的全参访问父类的全参.
    public Teacher() {
        super();
    }

    public Teacher(String name, int age) {
        super(name, age);
    }

    //2. 定义子类特有的内容.
    public void teach() {
        System.out.println("老师为了实现学生高薪就业, 要全力以赴讲课...");
    }

    @Override
    public void eat() {
        System.out.println("老师喝牛肉汤");
    }
}
